import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: Text("页面架子"),
      ),
      body: MyInfo("whb", 18),
    ),
  ));
}

// 无状态组件
class MyInfo extends StatelessWidget {
  String name;
  int age;

  MyInfo(this.name, this.age, {Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Text("我是$name今年$age岁"),
    );
  }
}
